//
//  SEGBasicBussinessEnums.m
//  SEGBasicBussiness
//
//  Created by 刘山 on 2018/3/21.
//  Copyright © 2018年 刘山. All rights reserved.
//

#import "SEGBasicBussinessEnums.h"

//#if __has_include(<Commom/SEGProfileManager.h>)
//#import <Commom/SEGProfileManager.h>
//#else
//#import "SEGProfileManager.h"
//#endif

//#if __has_include(<Commom/SEGQueryauthinfoManager.h>)
//#import <Commom/SEGQueryauthinfoManager.h>
//#else
//#import "SEGQueryauthinfoManager.h"
//#endif

#if __has_include(<SEGPlatform/SEGPlatformManager.h>)
#import <SEGPlatform/SEGPlatformManager.h>
#else
#import "SEGPlatformManager.h"
#endif


@implementation SEGBasicBussinessEnums
+(NSString*)getSEGEnumIdelExchange:(SEGEnumIdelExchange)IdelExchange{
    switch (IdelExchange) {
        case SEGEnumIdelExchange_SecondHand:
        {
            return @"9";
        }
            break;
        case SEGEnumIdelExchange_Lend:
        {
            return @"10";
        }
            break;
        case SEGEnumIdelExchange_Business:
        {
            return @"22";
        }
            break;
        case SEGEnumIdelExchange_Gift:
        {
            return @"21";
        }
        default:
        {
            return @"";//集市里只用到上面四个
        }
            break;
    }
}

+(NSString *)getSectionWithObjType:(NSString *)objType{
    if ([objType isEqualToString:@"9"]) {
        return @"2";
    }
    if ([objType isEqualToString:@"10"]) {
        return @"4";
    }
    if ([objType isEqualToString:@"21"]) {
        return @"3";
    }
    if ([objType isEqualToString:@"22"]) {
        return @"1";
    }
    return @"0";//集市里只用到上面四个
}


+(NSInteger)getIndexWithSEGEnumIdelExchange:(SEGEnumIdelExchange)IdelExchange{
    switch (IdelExchange) {
        case SEGEnumIdelExchange_SecondHand:
        {
            return 0;
        }
            break;
        case SEGEnumIdelExchange_Lend:
        {
            return 1;
        }
            break;
        case SEGEnumIdelExchange_Business:
        {
            return 2;
        }
            break;
        case SEGEnumIdelExchange_Gift:
        {
            return 3;
        }
        default:
        {
            return -1;//集市里只用到上面四个
        }
            break;
    }
}

/**
 * 获取集市显示价格
 * @author Wendy
 * @param marketType 集市分类枚举
 * @param salePrice 价格
 * @param rent 租金
 * @param unitName 租金单位
 * @see SEGEnumIdelExchange
 * @return 集市显示价格
 */
+ (NSString *)getShowPriceWithMarketType:(SEGEnumIdelExchange)marketType
                               salePrice:(NSString *)salePrice
                                    rent:(NSString *)rent
                                unitName:(NSString *)unitName
{
    NSString *showPrice;
    switch (marketType) {
        case SEGEnumIdelExchange_SecondHand:
        {
            showPrice = [NSString stringWithFormat:@"%@元",salePrice];
            break;
        }
        case SEGEnumIdelExchange_Lend:
        {
            showPrice = [NSString stringWithFormat:@"%@%@",rent, unitName];
            break;
        }
        case SEGEnumIdelExchange_Gift:
        {
            showPrice = @"";//赠送不显示价格
            break;
        }
        default:
        {
            showPrice = [NSString stringWithFormat:@"%@元",salePrice];
            break;
        }
    }
    return showPrice;
}

+(NSString*)getDescWithSEGEnumChangeCode:(SEGEnumChangeCode)changeCode{
    switch (changeCode) {
        case SEGEnumChangeCode_NoChange:
        {
            return @"";
        }
            break;
        case SEGEnumChangeCode_CanChange:
        {
            return @" 可交换 ";
        }
            break;
    }
}

+(NSString*)listWithSEGEnumScopeList:(SEGEnumScopeList)list{
    switch (list) {
        case SEGEnumScopeList_SameCity:
        {
            return @"同城";
        }
            break;
        case SEGEnumScopeList_All:
        {
            return @"全平台";
        }
            break;
        case SEGEnumScopeList_Community:
        {
            return @"本社区";
        }
            break;
    }
}

@end
